<table class="materias">
  <?php foreach ($materias as $i => $materia): ?>
    <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
      <td class="location">
        <?php echo $materia->getCodigo() ?>
      </td>
      <td class="position">
        <?php echo link_to($materia->getNombre(), 'show_materia', $materia) ?>
      </td>
      <td class="company">
        <?php echo $materia->getTipo() ?>
      </td>
    </tr>
  <?php endforeach; ?>
</table>